<template>
    <div>
        <el-breadcrumb separator="/">
            <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item><a href="#">菜单管理</a></el-breadcrumb-item>
        </el-breadcrumb>
        <el-button type="primary" plain @click="add" size="small">添加</el-button>
        <v-list @edit="edit"></v-list>
        <v-dialog @cancel="cancel" :dialogInfo="dialogInfo" ref="diaInfo"></v-dialog>
    </div>
</template>

<script setup lang="ts">
import vList from './list.vue';
import vDialog from './dialog.vue';
import { ref, reactive } from 'vue';
let dialogInfo = reactive({
    isShow: false,
    isAdd: true
})
let diaInfo = ref()
let add = () => {
    dialogInfo.isShow = true;
    dialogInfo.isAdd = true
}
let cancel = (e: any): void => {
    dialogInfo.isShow = e
}
let edit=(e:any):void=>{
    dialogInfo.isShow = true;
    dialogInfo.isAdd = false;
    // console.log(list[e]);
    diaInfo.value.lookup(e)
}
</script>

<style scoped>
.el-button {
    margin: 10px 5px;
}
</style>